//
//  PQIAPManager.h
//  chuyong
//
//  Created by tikeios_002 on 2023/10/10.
//

#import <Foundation/Foundation.h>
#import "StoreKit/StoreKit.h"

// 用户是否有购买没有上传到服务的信息
static NSString *USER_BUY_UPLOD_KEY = @"USER_BUY_UPLOD_KEY";

@interface PQIAPManager : NSObject<SKProductsRequestDelegate, SKPaymentTransactionObserver>

typedef void (^buyProductCompleteResponseSuccessBlock) (void);//成功回调
typedef void (^buyProductCompleteResponseFailuerBlock) (void);//失败回调
typedef void (^buyProductCompleteResponseCheckFailuerBlock) (NSString * str);//验证失败回调
+ (PQIAPManager *)sharedManager;
/**请求购买商品*/
//type 0创作者 1vip 2买币
- (void)requestProductWithId:(NSString *)productId orderId:(NSString *)orderId type:(int)type buySuccess:(buyProductCompleteResponseSuccessBlock)buySuccess buyFailuer:(buyProductCompleteResponseFailuerBlock)buyFailuer checkFailuer:(buyProductCompleteResponseCheckFailuerBlock)checkFailuer;
/**请求恢复购买*/
- (void)restoreBuy;

@end
